import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
	meta: {
		title: '登录',
		hidden: true
	},
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/login.vue')
  },
  {
    path: '/',
    name: 'layout',
	meta: {
		title: '首页',
		icon: require('@/assets/icon/home_icon.png'),
		icon_sl: require('@/assets/icon/home_icon_sl.png'),
	},
    component: () => import('../components/Layout.vue'),
	children: [
		{
			path: 'home',
			name: 'home',
			component: () => import('../views/home.vue')
		}
	]
  },
  {
    path: '/',
    name: 'layout',
  	meta: {
  		title: '视频',
		icon: require('@/assets/icon/vedios_icon.png'),
		icon_sl: require('@/assets/icon/vedios_icon_sl.png'),
  	},
    component: () => import('../components/Layout.vue'),
  	children: [
  		{
  			path: 'vedios',
  			name: 'vedios',
  			component: () => import('../views/vedios.vue')
  		}
  	]
  },
  {
    path: '/',
    name: 'layout',
  	meta: {
  		title: '评论',
		icon: require('@/assets/icon/comment_icon.png'),
		icon_sl: require('@/assets/icon/comment_icon_sl.png'),
  	},
    component: () => import('../components/Layout.vue'),
  	children: [
  		{
  			path: 'comment',
  			name: 'comment',
  			component: () => import('../views/comment.vue')
  		}
  	]
  },
  {
    path: '/',
    name: 'layout',
  	meta: {
  		title: '我的',
		icon: require('@/assets/icon/profile_icon.png'),
		icon_sl: require('@/assets/icon/profile_icon_sl.png'),
  	},
    component: () => import('../components/Layout.vue'),
  	children: [
  		{
  			path: 'profile',
  			name: 'profile',
  			component: () => import('../views/profile.vue')
  		}
  	]
  },
]

const router = new VueRouter({
  routes
})

export default router
